{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Machine Learning in Life Scicence WS 2016 - 2017\n",
    "## Exercise 1 - Dataset  \n",
    "a) Create a dataset in R^2 with two classes (positive with target 1 and negative with target 0). Consider 100 datapoints for each class. Let the instances for each class be sampled from a bivariate Gaussian distribution with the same variance."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function min in module builtins:\n",
      "\n",
      "min(...)\n",
      "    min(iterable, *[, default=obj, key=func]) -> value\n",
      "    min(arg1, arg2, *args, *[, key=func]) -> value\n",
      "    \n",
      "    With a single iterable argument, return its smallest item. The\n",
      "    default keyword-only argument specifies an object to return if\n",
      "    the provided iterable is empty.\n",
      "    With two or more arguments, return the smallest argument.\n",
      "\n",
      "[3, 4, 5, 6, 8, 10, 9, 12, 15]\n",
      "[2, 3]\n",
      "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n"
     ]
    }
   ],
   "source": [
    "# Implementation taken from the sklearn website:\n",
    "# https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.multivariate_normal.html\n",
    "help (min)\n",
    "\n",
    "lst1 = [1, 2, 3]\n",
    "lst2 = [3, 4, 5]\n",
    "print ( [x * y for x in lst1 for y in lst2])\n",
    "\n",
    "print ([x for x in lst1 if 4 > x > 1])\n",
    "print ( [1] * 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Importing numpy and matplotlib\n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Multivariate "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#Settings\n",
    "## Creating dataset here, 100 data points \n",
    "# numpy.random.multivariate_normal(mean, cov[size])\n",
    "# Draw random samples from multivariate normal distribution\n",
    "mean = [0, 0]\n",
    "cov = [[0.7,0.5 ], [0.5, 0.5]] # diagonal variance \n",
    "n = 100 # number of points \n",
    "#Diagonal covariance means that points are oriented along x or y-axis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#Example taking from the website of sklearn\n",
    "# Here we are considering \"X\" is for multivariate\n",
    "\n",
    "x = np.random.multivariate_normal(mean, cov, n )\n",
    "y = []\n",
    "\n",
    "for (x1,x2) in x:\n",
    "    if x1 >= 0 and x2 >= 0:\n",
    "        y.append(1)\n",
    "    else:\n",
    "        y.append(0)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Before plotting separate +ve and -ve values\n",
    "\n",
    "positive = [ (x1,x2) for (x1,x2) in x if x1 >= 0 and x2 >= 0]\n",
    "negative = [ (x1,x2) for (x1,x2) in x if x1 < 0 or x2 < 0 ]\n",
    "\n",
    "#print(positive)\n",
    "#print (len(positive))\n",
    "\n",
    "positive= np.asarray(positive)\n",
    "size =  int(positive.size/2)\n",
    "positive= positive.reshape(size,2)\n",
    "\n",
    "\n",
    "negative= np.asarray(negative)\n",
    "size =  int(negative.size/2)\n",
    "negative= negative.reshape(size,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgwAAAFkCAYAAABMyWOlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAIABJREFUeJzt3X2QW3d97/HP12p4yi2O2Qw2KRkCttakt8VBG5I6sWOo\n12jtDoS23BYtNGnoJARoyvgOA1NKSyHTBsJDgNBAClMgbRFw7x1KLne962wgGAN5YJeEOy2x1k54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43K7icttnSfpcnEHFycxOVvHfDCsdelHpv4tFd/9p4zMHk5ldJykn6dWSHqvYXHDZ3R+PL7L4\nmNnfqjis+xNJv6ripPodkl4ZZ1zdMhBDEmGZ2W9I+pikl6i4pvp+Ff9y/8bd748ztriUutxr5yuY\nihPjU3VOGQpm9llJF9V56xXufqDX8cTBzN6iYhK5XsX6A1e4+/fijSo+ZrZDxWG72n80P+/uA9sz\n10hpWKbeDeQSd7+h1/EkgZl9RtJvS3qepGVJP5D0fnf/eqyBdclQJQwAAKA9A7FKAgAARIuEAQAA\nBCJhAAAAgUgYAABAIBIGAAAQiIQBAAAEImEAAACBSBgAAEAgEgYAABCIhAEAAAQiYQAAAIH+P1nG\nuNwyXiZWAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x236ecf867f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(positive[:,0], positive[:,1], color='black')\n",
    "#plt.plot(testX, predictY, color='blue', linewidth=3)\n",
    "plt.scatter(negative[:,0], negative[:,1], color='red')\n",
    "\n",
    "\n",
    "plt.axis('equal')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#Apply Linear Model on different type of distributions\n",
    "# Split the data into training/testing sets\n",
    "trainX =x[:-20] # take 80 sample dataset as a Training\n",
    "testX = x[-20:] # take 20 sample datset for testing\n",
    "\n",
    "\n",
    "# Split target also into training/ testing sets\n",
    "trainY =  y[:-20]\n",
    "testY =   y[-20:]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Linear Model Starts Here:\n",
      "Coefficients: [ 0.28703027  0.31470515]\n",
      "Mean squared error: 0.01\n",
      "Variance score: 0.63\n"
     ]
    }
   ],
   "source": [
    "from sklearn import linear_model\n",
    "\n",
    "#Using Linear Model \n",
    "print ('Linear Model Starts Here:')\n",
    "\n",
    "#Intialize\n",
    "regr = linear_model.LinearRegression()\n",
    "\n",
    "\n",
    "# Fit\n",
    "regr.fit(trainX, trainY);\n",
    "\n",
    "# The Coefficients\n",
    "print ('Coefficients:', regr.coef_)\n",
    "\n",
    "#Predict\n",
    "predictY = regr.predict(testX)\n",
    "\n",
    "\n",
    "#The mean squared error\n",
    "print(\"Mean squared error: %.2f\" % np.mean((predictY) - testY) **2  ) # (y^ - y)^2\n",
    "\n",
    "#Explained variance score: 1 is perfect\n",
    "print ('Variance score: %.2f' % regr.score(testX, testY))\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "13\n",
      "13\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfkAAAFeCAYAAACGr2ayAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAEKRJREFUeJzt3V9orPldx/HPr7PI9kYIFVHQ2pJkwmLVuqvgn1qxjUwa\nhHrhH5IW/+CfQi+sggp7IxUFq70QsVhE1Au3OyIUpBe7GRkslVqldBfU6ur8kbZ3gk2gUFzB6eNF\nztndnJ6TPTOZ5Hnml9cLlnKeZ3bPl1z0nWfm9/tNaZomAEB9XtP2AADA9RB5AKiUyANApUQeACol\n8gBQKZEHgEqJPABU6pG2/uJSyuuSDJJ8LsmLbc0BABvo0SRvSDJqmuaLD3pRa5HPeeA/0uLfDwCb\n7l1Jnn7QzTYj/7kkeeqpp/LYY4+1OAYAbJYXXngh7373u5M7LX2QNiP/YpI89thjefzxx1scAwA2\n1qUfd1t4BwCVEnkAqJTIA0ClRB4AKiXyAFApkQeASok8AFRK5AGgUiIPAJUSeQColMgDQKVEHgAq\nJfIAUCmRB4BKiTwAVErkAaBSIg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 0x236ee601128>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# This is because we are drawing it in 2d, must be drawn in 3D for better visualization\n",
    "# Plot outputs\n",
    "\n",
    "\n",
    "\n",
    "X1 = []\n",
    "X2 = []\n",
    "X3 = []\n",
    "X4 = []\n",
    "i = 0;\n",
    "for (y) in predictY:\n",
    "    if y > 0:\n",
    "        X1.append(testX[i,0])\n",
    "        X2.append(testX[i,1])\n",
    "    else:\n",
    "        X3.append(testX[i,0])\n",
    "        X4.append(testX[i,1])\n",
    "    i = i + 1   \n",
    "\n",
    "print (len(X1))\n",
    "print (len(X2))\n",
    "\n",
    "plt.scatter(X1, X2,  color='black')\n",
    "\n",
    "plt.scatter(X3, X4,  color='red')\n",
    "\n",
    "#plt.plot(testX[:,0], predictY, color='blue',        linewidth=3)\n",
    "plt.xlabel('X1')\n",
    "plt.ylabel('X2')\n",
    "plt.xticks(())\n",
    "plt.yticks(())\n",
    "\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### This is because we are drawing it in 2d, must be drawn in 3D for better visualization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeQAAAFKCAYAAADMuCxnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAIABJREFUeJzt3Xd4VNX6NuBnEgKB0KT3IkXpXVBABIWAgIB0qYIgiKAI\nilg4oMeCYD+AHESRZkMFDiBIExUUMAgonUhv0ksgkGTe74/3m1+m7L1nTzJJJslzX9dch8yuM3B8\nstZe610OEQERERFlrLCMvgEiIiJiIBMREYUEBjIREVEIYCATERGFAAYyERFRCGAgExERhQAGMhER\nUQhgIBMREYWAHHZ2cjgchQFEAzgMID4tb4iIiCiLiQRQAcAqETlvtpOtQIaG8YIg3BQREVF21QfA\nQrONdg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nTEQUXPzPKv2fTZusw3jBAi1QwjAmIgo+tpAJADB6NPDee+bbjx+3nvJERESpw0DO5m7dAnLlMt9e\nu7au0cxWMRFR2uJ/ZrOxHTusw3jmTN2HYUxElPb4n9ps6pVXrMty/v23LgNJRETpg13W2YyIVtS6\ncMF4e5kywOHDQHh4ut4WEVG2xxZyNvPZZ+ZhPGUKcOwYw5iIKCOwhZzNrFxp/P7u3UC1aul7L0RE\nlIwt5GymVSvPnyMjgYQEhjERUUZjCzmbGTJE1yrevh3o0AFo0iSj74iIiAAGcrbjcADduumLiIhC\nB7usiYiIQgADmYiIKAQwkImIiEIAA5mIiCgEMJCJiIhCAAOZiIgoBDCQiYiIQgADmYiIKAQwkImI\niEIAA5mIiCgEMJCJiIhCAAOZiIgoBDCQiYiIQgADmYiIKAQwkImIiEIAA5mIiCgEMJCJiIhCAAOZ\niIgoBDCQiYiIQgADmYiIKAQwkImIiEIAA5mIiCgE5LC5XyQA7NmzJw1vhYiIKOtxy85Iq/0cIuL3\nZA6H4xEAC1J/W0RERNlWHxFZaLbRbiAXBhAN4DCA+KDdGhERUdYXCaACgFUict5sJ1uBTERERGmL\ng7qIiIhCAAOZiIgoBDCQiYiIQgADmYiIKAQwkImIiEIAA5mIiCgEMJCJiIhCwP8Dw895TgJxoT0A\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x236ee5f8d30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# This is because we are drawing it in 2d, must be drawn in 3D for better visualization\n",
    "# Plot outputs\n",
    "plt.scatter(testX[:,0], testY,  color='black')\n",
    "plt.plot(testX[:,0], predictY, color='blue',\n",
    "         linewidth=3)\n",
    "\n",
    "plt.xticks(())\n",
    "plt.yticks(())\n",
    "\n",
    "plt.show()\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exercise 2 - Linear Model\n",
    "a) Write the code to compute a Linear classification model. Apply it to the dataset created in Exercise 1. Plot the predicted class for a regular grid in R^2. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exercise 3 - kNN Model\n",
    "a) Write the code to compute a KNN model. Apply it to the dataset created in Exercise 1. Plot the predicted class for a regular grid in R^2. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0]\n",
      "[1 0 0 0 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 0]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "\n",
    "\n",
    "classifier = KNeighborsClassifier(n_neighbors = 2)\n",
    "classifier.fit(trainX,trainY)\n",
    "\n",
    "predictions = classifier.predict(testX)\n",
    "# Checking accuracy of the classifier\n",
    "from sklearn.metrics import accuracy_score\n",
    "accuracy_score(testY,predictions)\n",
    "print(testY)\n",
    "\n",
    "print(predictions)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
